﻿using System;
using System.IO;
using OpenLS.Spreadsheet.Formats.Biff.Records;

namespace OpenLS.Spreadsheet.Formats.Biff.Records
{
    internal class TxoRun
    {
        private FormatRun _formatRun;
        private ushort _unused1;
        private ushort _unused2;

        public TxoRun(FormatRun formatRun)
        {
            _formatRun = formatRun;
        }

        public TxoRun()
        {
        }

        public int Index
        {
            get { return _formatRun.Index; }
        }

        public ushort FontId
        {
            get { return _formatRun.FontId; }
        }

        public void Read(MultiBinaryReader reader)
        {
            _formatRun = new FormatRun(reader);
            this._unused1 = reader.ReadUInt16();
            this._unused2 = reader.ReadUInt16();
        }

        public void Write(BinaryWriter writer)
        {
            _formatRun.Write(writer);
            writer.Write(_unused1);
            writer.Write(_unused2);
        }
    }
}